﻿using System.Windows.Controls;
using System.ComponentModel;
using AdminApp.Web;

namespace CeBIT2010
{
    public partial class SmallSessionDisplay : UserControl
    {
        public SmallSessionDisplay()
        {
            InitializeComponent();

            this.Loaded += (s, e) =>
                {
                    if (DesignerProperties.IsInDesignTool)
                    {
                        AllSlots slot = new AllSlots();
                        slot.SpeakerFirstname = "Anton";
                        slot.SpeakerLastname = "Meier";
                        slot.SessionShortTitle = "Windows 7 Highlights";
                        slot.SlotTime = new System.TimeSpan(10, 23, 17);
                        this.DataContext = slot;
                    }
                    DisplayType = DisplayType.Current;
                };
        }

        private DisplayType _displayType = DisplayType.Current;
        public DisplayType DisplayType
        {
            get { return _displayType; }
            set 
            {
                _logoGrid.Children.Clear();
                _displayType = value;

                switch (_displayType)
                {
                    case CeBIT2010.DisplayType.Current:
                        OnAirControl c = new OnAirControl();
                        _logoGrid.Children.Add(c);
                        break;

                    case CeBIT2010.DisplayType.Next:
                        NextControl n= new NextControl();
                        _logoGrid.Children.Add(n);
                        break;

                    default:
                        break;
                }
            }
        }
    }

    public enum DisplayType
    {
        Current, Next
    }
}
